Skip to content

DX: One-command UI preview, auto-published manifest, and smoother Anvil/MetaMask flow#19

Merged
snissn merged 1 commit into
masterfrom
feat/dx-preview-ui
Feb 5, 2026
Merged

DX: One-command UI preview, auto-published manifest, and smoother Anvil/MetaMask flow#19
snissn merged 1 commit into
masterfrom
feat/dx-preview-ui

Conversation

@snissn
Copy link
Copy Markdown
Contributor

@snissn snissn commented Feb 5, 2026

Problem

The Quickstart path built and deployed contracts, but it was unclear how to actually load the website.

Users ended up reaching for an ad-hoc static server (often Python), and even after th deploy the UI could still show deploymentEntrypointAddress = 0x0 because the served manifest copy inside ui-site/ was not being updated.

What changed

  • New th preview command to serve the generated static UI locally (no Python required).
    • Serves <buildDir>/ui-site with trailing-slash handling (Next export) and Cache-Control: no-store so manifest updates show up immediately.
    • Prints the local URL plus manifest/deployment status and the exact next step if the app is not deployed yet.
  • Manifest auto-publishing
    • th deploy and th verify now re-publish the updated manifest.json into the served UI locations:
      • ui-site/.well-known/tokenhost/manifest.json
      • ui-site/manifest.json
    • This eliminates the “deploy succeeded but UI still shows 0x0” foot-gun for local workflows.
  • Clearer CLI guidance
    • th build now prints concrete next steps (deploy + preview).
    • th init project README now includes th preview.
  • Better runtime UX
    • UI “Not deployed” message is explicit about what is missing and where the manifest is read from.
    • MetaMask/Anvil flow improved: when switching to chainId 31337 fails because the chain isn't configured (MetaMask 4902), the UI attempts wallet_addEthereumChain then retries.
  • Docs
    • Root Quickstart includes th preview and a short MetaMask chain note.

How to test

  1. pnpm install
  2. pnpm th build apps/example/job-board.schema.json --out artifacts/job-board
  3. In another terminal: anvil
  4. pnpm th deploy artifacts/job-board --chain anvil
  5. pnpm th preview artifacts/job-board and open http://127.0.0.1:3000/

Notes

  • This is additive and backwards-compatible. The UI remains a static export; th preview is a tiny Node static server intended for local DX.

@snissn snissn merged commit 12dec2a into master Feb 5, 2026
1 check passed
@snissn snissn deleted the feat/dx-preview-ui branch February 5, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant